<template>
  <ComponentPage
    title="按钮组件库"
    :componentGlob="buttonComponents"
    :pageSize="8"
    @code-click="onCodeClick"
    @page-change="onPageChange"
  />
</template>

<script setup>
import ComponentPage from './ComponentPage.vue'

// ✅ 动态导入目标目录下所有 .vue 文件
const buttonComponents = import.meta.glob('../components/buttons/*.vue')

// 可选：监听事件
// const onCodeClick = (name) => {
//   console.log('用户点击了:', name)
// }

// const onPageChange = (page) => {
//   console.log('分页切换到:', page)
// }
</script>